﻿//test('Object Literal Test', function () {
//    expect(2);

//    var expected = 'Vehicle: 2000 Ford Fusion';
//    var actual = car1.getInfo();
//    equal(actual, expected, 'Expected value: ' + expected + ' Actual value: ' + actual);

//    var expected = 'Vehicle: 2010 BMW Z4';
//    var actual = car2.getInfo();
//    equal(actual, expected, 'Expected value: ' + expected + ' Actual value: ' + actual);
//});
//test('Create Instances Test Using Factory Patter', function () {
//    expect(2);

//    var car1 = getVehicle(2000, 'Ford', 'Fusion');
//    var car2 = getVehicle(2010, 'BMW', 'Z4');

//    var expected = 'Vehicle: 2000 Ford Fusion';
//    var actual = car1.getInfo();
//    equal(actual, expected, 'Expected value: ' + expected + ' Actual value: ' + actual);

//    var expected = 'Vehicle: 2010 BMW Z4';
//    var actual = car2.getInfo();
//    equal(actual, expected, 'Expected value: ' + expected + ' Actual value: ' + actual);
//});
////test('Function Test', function () {
////    expect(2);

////    var car1 = new Vehicle(2000, 'Ford', 'Fusion');
////    var car2 = new Vehicle(2010, 'BMW', 'Z4');

////    var expected = 'Vehicle: 2000 Ford Fusion';
////    var actual = car1.getInfo();
////    equal(actual, expected, 'Expected value: ' + expected + ' Actual value: ' + actual);

////    expected = 2000;
////    actual = year;
////    equal(actual, expected, 'Expected value: ' + expected + ' Actual value: ' + actual);
////});
//test('Function Replacement Test', function () {
//    expect(2);

//    var car1 = new Vehicle(2000, 'Ford', 'Fusion');
//    var car2 = new Vehicle(2010, 'BMW', 'Z4');
//    car1.getInfo = function () {
//        return 'This is a Car';
//    }
//    var expected = 'This is a Car';
//    var actual = car1.getInfo();
//    equal(actual, expected, 'Expected value: ' + expected + ' Actual value: ' + actual);

//    expected = 'Vehicle: 2010 BMW Z4';
//    actual = car2.getInfo();
//    equal(actual, expected, 'Expected value: ' + expected + ' Actual value: ' + actual);
//});
//test('Instance Test Using Prototype', function () {
//    expect(2);

//    var car1 = new Vehicle(2000, 'Ford', 'Fusion');
//    var car2 = new Vehicle(2010, 'BMW', 'Z4');

//    var expected = 'Vehicle: 2000 Ford Fusion';
//    var actual = car1.getInfo();
//    equal(actual, expected, 'Expected value: ' + expected + ' Actual value: ' + actual);

//    expected = 'Vehicle: 2010 BMW Z4';
//    actual = car2.getInfo();
//    equal(actual, expected, 'Expected value: ' + expected + ' Actual value: ' + actual);
//});
//test('Instance Test Using Prototype Replace Function', function () {
//    expect(2);

//    var car1 = new Vehicle(2000, 'Ford', 'Fusion');
//    var car2 = new Vehicle(2010, 'BMW', 'Z4');
//    Vehicle.prototype.getInfo = function () {
//        return 'Car: ' + this.year + ' ' + this.make + ' ' + this.model;
//    }

//    var expected = 'Car: 2000 Ford Fusion';
//    var actual = car1.getInfo();
//    equal(actual, expected, 'Expected value: ' + expected + ' Actual value: ' + actual);

//    expected = 'Car: 2010 BMW Z4';
//    actual = car2.getInfo();
//    equal(actual, expected, 'Expected value: ' + expected + ' Actual value: ' + actual);
//});
//test('Instance Test Using Prototype And Getters', function () {
//    expect(4);

//    var car1 = new Vehicle(2000, 'Ford', 'Fusion');
//    var car2 = new Vehicle(2010, 'BMW', 'Z4');

//    var expected = 'Vehicle: 2000 Ford Fusion';
//    var actual = car1.getInfo();
//    equal(actual, expected, 'Expected value: ' + expected + ' Actual value: ' + actual);

//    expected = 'Vehicle: 2010 BMW Z4';
//    actual = car2.getInfo();
//    equal(actual, expected, 'Expected value: ' + expected + ' Actual value: ' + actual);
//    Vehicle.prototype.getInfo = function () {
//        return 'Car Year: ' + this.getYear()
//            + ' Make: ' + this.getMake()
//            + ' Model: ' + this.getModel();
//    };

//    expected = 'Car Year: 2000 Make: Ford Model: Fusion';
//    actual = car1.getInfo();
//    equal(actual, expected, 'Expected value: ' + expected + ' Actual value: ' + actual);

//    expected = 'Car Year: 2010 Make: BMW Model: Z4';
//    actual = car2.getInfo();
//    equal(actual, expected, 'Expected value: ' + expected + ' Actual value: ' + actual);
//});
test('Car Inheritance Test', function () {
    expect(6);

    var c = new Car(2012, 'Toyota', 'Rav4');
    var actual = c.year;
    var expected = 2012;
    equal(actual, expected, 'Expected value: ' + expected + ' Actual value: ' + actual);

    actual = c.make;
    expected = 'Toyota';
    equal(actual, expected, 'Expected value: ' + expected + ' Actual value: ' + actual);

    actual = c.model;
    expected = 'Rav4';
    equal(actual, expected, 'Expected value: ' + expected + ' Actual value: ' + actual);

    actual = c.wheelQuantity;
    expected = 4;
    equal(actual, expected, 'Expected value: ' + expected + ' Actual value: ' + actual);

    actual = c.getInfo();
    expected = 'Vehicle Type: Car 2012 Toyota Rav4';
    equal(actual, expected, 'Expected value: ' + expected + ' Actual value: ' + actual);

    actual = c.startEngine();
    expected = 'Vroom';
    equal(actual, expected, 'Expected value: ' + expected + ' Actual value: ' + actual);
});
test('Boat Inheritance Test', function () {
    expect(6);

    var b = new Boat(1994, 'Sea Ray', 'Signature 200');
    var actual = b.year;
    var expected = 1994;
    equal(actual, expected, 'Expected value: ' + expected + ' Actual value: ' + actual);

    actual = b.make;
    expected = 'Sea Ray';
    equal(actual, expected, 'Expected value: ' + expected + ' Actual value: ' + actual);

    actual = b.model;
    expected = 'Signature 200';
    equal(actual, expected, 'Expected value: ' + expected + ' Actual value: ' + actual);

    actual = b.propellerBladeQuantity;
    expected = 3;
    equal(actual, expected, 'Expected value: ' + expected + ' Actual value: ' + actual);

    actual = b.getInfo();
    expected = 'Vehicle Type: Boat 1994 Sea Ray Signature 200';
    equal(actual, expected, 'Expected value: ' + expected + ' Actual value: ' + actual);

    actual = b.startEngine();
    expected = 'Vroom';
    equal(actual, expected, 'Expected value: ' + expected + ' Actual value: ' + actual);
});